#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int minNumberInRotateArray(int* nums, int numsLen) {
    int left = 0, right = numsLen - 1, min = nums[0];
    while (left < right)
    {
        int mid = (right + left) / 2;
        if (nums[mid] > nums[right])
            left = mid + 1;
        else if (nums[mid] < nums[right])
            right = mid;
        else
            right--;
    }
    return nums[right];
}
int main()
{
    int nums[5] = { 2,3,4,1,2 };
    int numsLen = 5;
    printf("%d", minNumberInRotateArray(nums, numsLen));

    return 0;
}